import React from 'react';
import { Provider  } from 'react-redux';
import Storage from 'react-native-storage';
import {AsyncStorage} from 'react-native';
import indexModel from './models/index'
import App from './routes'

var storage = new Storage({
  size: 1000,
  storageBackend: AsyncStorage,
  defaultExpires: null,
  enableCache: true,
});

global.storage = storage;
 
import { create } from 'dva-core';
 
const models = [indexModel];
 
const app = create();
 
models.forEach((o) => {
  app.model(o);
});
 
app.start();

const store = app._store;

 
export default class extends React.Component {
  render() {
    return (
      <Provider store={store}>
        <App/>
      </Provider>
    );
  }
}